import { personGetFormatServe } from '@/api/person'
import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useFormatStore = defineStore('format', () => {
  const allWeek = ref([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
  const columnLabels = ref(['周一', '周二', '周三', '周四', '周五', '周六', '周日'])
  const format = ref([])
  const today = ref(0)
  const getFormat = async () => {
    const res = await personGetFormatServe()
    format.value = res.record
  }
  const setToday = (day) => {
    today.value = day
  }
  return {
    columnLabels,
    allWeek,
    format,
    today,
    getFormat,
    setToday
  }
})
